﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace BLL
{
    public static class TimKiem
    {
        public static DataTable TimKiemTuongDoi_(DataTable _BangNguon, string _TuKhoa)
        {
            DataTable _KetQua = _BangNguon.Clone();
            int dong = _BangNguon.Rows.Count;
            int cot = _BangNguon.Columns.Count;
            for (int i = 0; i < dong; i++)
            {
                for (int j = 0; j < cot-1; j++)
                {
                    if (TimChuoi.CoTrongChuoiHayKhong_(TimChuoi.ChuyenSangChuoiKhongDau_(_BangNguon.Rows[i][j].ToString().ToLower()), TimChuoi.ChuyenSangChuoiKhongDau_(_TuKhoa).ToLower()))
                    {
                        _KetQua.ImportRow(_BangNguon.Rows[i]);
                        break;
                    }
                }
            }
            return _KetQua;
        }
    }
}
